@import "../../../styles/themes/variable";
@import "../../../styles/mixins/clearfix";

@mixin placeholder($color: $input-placeholder-color) {
  // Firefox
  &::-moz-placeholder {
    color: $color;
    opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
  }
  // Internet Explorer 10+
  &:-ms-input-placeholder {
    color: $color;
  }
  // Safari and Chrome
  &::-webkit-input-placeholder {
    color: $color;
  }
}

// input status
// == when focus or actived
@mixin active($color: $outline-color) {
  border-color: darken($color, 5%);
  outline: 0;
  box-shadow: 0 0 $outline-blur-size $outline-width rgba($color, 0.2);
}

// == when hoverd
@mixin hover($color: $input-hover-border-color) {
  border-color: darken($color, 5%);
}

@mixin disabled() {
  background-color: $input-disabled-bg;
  opacity: 1;
  cursor: not-allowed;
  color: $input-disabled-color;
  border-color: $input-border-color;
  &:hover {
    @include hover($input-border-color);
  }
}

@mixin input() {
  position: relative;
  display: inline-block;
  width: 100%;
  height: $input-height-base;
  padding: $input-padding-vertical-base $input-padding-horizontal-base;
  color: $input-color;
  font-size: $font-size-base;
  line-height: $input-height-base;
  background-color: $input-bg;
  background-image: none;
  border: $border-width-base $border-style-base $input-border-color;
  border-radius: $border-radius-base;
  transition: all 0.3s;
  @include placeholder(); // Reset placeholder

  &:hover {
    @include hover();
  }

  &:focus {
    @include active();
  }
  &-disabled {
    @include disabled();
  }
  &[disable] {
    @include disabled();
  }
}

.cad-search {
  width: 100%;
  height: 100%;
  overflow: hidden;

  /deep/ .apes-card-body {
    padding: 6px;
  }

  .cad-title-wrapper {
    display: flex;

    .query-wrapper {
      min-width: 640px;
      margin-bottom: 0px !important;

      .query-control-button {
        margin-bottom: 4px;
      }

      .query-input {
        input {
          width: 33%;
        }
      }
    }

    .assembly-drawing-logo {
      width: 168px;
      height: 84px;
    }

    .assembly-drawing-btn {
      position: absolute;
      left: 180px;
      top: 6px;
    }

    .assembly-drawing-VIN {
      position: absolute;
      left: 180px;
      bottom: 5px;
      font-size: 16px;
      font-weight: bold;
    }

    .model-info-wrapper {
      margin-bottom: 0px !important;

      /deep/ .apes-descriptions-row > td {
        padding-bottom: 8px;
      }
    }

    .car-disclaimer {
      position: fixed;
      top: 1vw;
      right: 1vw;
      color: red;
      font-weight: bold;
      line-height: 1;
    }
  }

  .cad-control {
    line-height: 40px;
    @include clearfix;
  }

  .cad-control-showHidden {
    display: inline-block;
    margin-right: 16px;
    font-size: 16px;
    position: relative;
    cursor: pointer;

    i {
      position: relative;
      top: 3px;
    }
  }

  .cad-control-step {
    font-weight: bold;
    cursor: pointer;

    &:hover {
      color: #0589DD;
    }
  }

  .cad-wrapper {
    position: relative;
    display: flex;
    height: calc(100% - 138px);
    background-color: #f3f3f3;

    .cad-menu {
      flex: 0 0 120px;
      min-width: 200px;
      overflow: auto;
      transition: 0.3ms all ease;
      height: 100%;
    }

    .cad-content {
      display: flex;
      flex: 1 1 auto;
      overflow-y: auto;
      height: 100%;

      /deep/ .apes-card-body {
        width: 100%;
        display: flex;
      }

      cad-level-list {
        flex: 1 1 auto;
      }

      .cad-image-content {
        flex: 1 1 auto;
        overflow: hidden;
        margin: 0 !important;

        /deep/ .apes-card-body {
          width: 100%;
          height: 100%;
          display: block;
        }
      }

      .cad-parts-list {
        flex: 0 0 65%;
        background-color: #fff;
        margin: 0 !important;

        /deep/ .apes-card-body {
          width: 100%;
          height: 100%;
          display: block;
        }
      }

      .cad-search-content {
        flex: 100%;
        background-color: #fff;
        margin: 0 !important;

        /deep/ .apes-card-body {
          width: 100%;
          height: 100%;
          display: block;
          overflow: auto;
        }
      }
    }

    .cad-load-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #fff;
      border-top: 1px solid #e8e8e8;

      //.cad-container {
      //  display: flex;
      //  justify-content: space-around;
      //  width: 75px;
      //  height: 60px;
      //  text-align: center;
      //  font-size: 10px;
      //
      //  .cad-boxLoading {
      //    background-color: #87ceeb;
      //    height: 100%;
      //    width: 8px;
      //    display: inline-block;
      //
      //    -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
      //    animation: stretchdelay 1.2s infinite ease-in-out;
      //  }
      //
      //  .cad-boxLoading2 {
      //    -webkit-animation-delay: -1.1s;
      //    animation-delay: -1.1s;
      //  }
      //
      //  .cad-boxLoading3 {
      //    -webkit-animation-delay: -1.0s;
      //    animation-delay: -1.0s;
      //  }
      //
      //  .cad-boxLoading4 {
      //    -webkit-animation-delay: -0.9s;
      //    animation-delay: -0.9s;
      //  }
      //
      //  .cad-boxLoading5 {
      //    -webkit-animation-delay: -0.8s;
      //    animation-delay: -0.8s;
      //  }
      //}

      .cad-container {
        margin: 100px auto;
        width: 450px;
        text-align: center;
        position: relative;
        top: -50px;
      }

      .cad-load-title {
        font-size: 15px;
      }

      .cad-boxLoading-rail {
        height: 10px;
        background-color: #a4c2fb;
        width: 100%;
        border-radius: 4px;
        transition: 0.4s linear;
        transition-property: width, background-color;
        background-image: linear-gradient(45deg, #6199ff, transparent, #6199ff, transparent, #6199ff, transparent);
        animation: colorAnimation 1s ease infinite;
      }

      .cad-progress {
        padding: 5px;
        background: rgba(0, 0, 0, 0.25);
        border-radius: 6px;
        box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.25), 0 1px rgba(255, 255, 255, 0.08);
        //.cad-boxLoad {
        //  width: 10%;
        //}
        .cad-boxLoading {
          width: 20%;
          animation: progressAnimationStrike 1s;
        }

        .cad-boxLoading2 {
          width: 40%;
          animation: progressAnimationStrike2 1s;
        }

        .cad-boxLoading3 {
          width: 60%;
          animation: progressAnimationStrike3 1s;
        }

        .cad-boxLoading4 {
          width: 80%;
          animation: progressAnimationStrike4 1s;
        }

        .cad-boxLoading5 {
          width: 100%;
          animation: progressAnimationStrike5 1s;
        }
      }

      @keyframes colorAnimation {
        0% {
          background-image: linear-gradient(45deg, #6199ff, transparent, #6199ff, transparent, #6199ff, transparent);
        }
        25% {
          background-image: linear-gradient(45deg, transparent, #6199ff, transparent, #6199ff, transparent, #6199ff);
        }
        50% {
          background-image: linear-gradient(45deg, #6199ff, transparent, #6199ff, transparent, #6199ff, transparent);
        }
        75% {
          background-image: linear-gradient(45deg, transparent, #6199ff, transparent, #6199ff, transparent, #6199ff);
        }
        100% {
          background-image: linear-gradient(45deg, #6199ff, transparent, #6199ff, transparent, #6199ff, transparent);
        }
      }

      @keyframes progressAnimationStrike {
        from {
          width: 0;
        }
        to {
          width: 20%;
        }
      }
      @keyframes progressAnimationStrike2 {
        from {
          width: 20%;
        }
        to {
          width: 40%;
        }
      }
      @keyframes progressAnimationStrike3 {
        from {
          width: 40%;
        }
        to {
          width: 60%;
        }
      }
      @keyframes progressAnimationStrike4 {
        from {
          width: 60%;
        }
        to {
          width: 80%;
        }
      }
      @keyframes progressAnimationStrike5 {
        from {
          width: 80%;
        }
        to {
          width: 100%;
        }
      }
    }

  }

  @-webkit-keyframes stretchdelay {
    0%, 40%, 100% {
      -webkit-transform: scaleY(0.4)
    }
    20% {
      -webkit-transform: scaleY(1.0)
    }
  }
  @keyframes stretchdelay {
    0%, 40%, 100% {
      transform: scaleY(0.4);
      -webkit-transform: scaleY(0.4);
    }
    20% {
      transform: scaleY(1.0);
      -webkit-transform: scaleY(1.0);
    }
  }

  /deep/ button[disabled],
  /deep/ button[disabled].active,
  /deep/ button[disabled]:active,
  /deep/ button[disabled]:focus,
  /deep/ button[disabled]:hover {
    color: rgba(0, 0, 0, .25);
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    text-shadow: none;
    box-shadow: none;
  }

  input {
    @include input();
  }

  &::-webkit-scrollbar {
    width: 3px;
    height: 1px
  }

  &::-webkit-scrollbar-track-piece {
    background-color: rgb(241, 241, 241);
    -webkit-border-radius: 2px
  }

  &::-webkit-scrollbar-thumb:vertical {
    height: 5px;
    background-color: rgb(169, 169, 169);
    -webkit-border-radius: 2px
  }

  &::-webkit-scrollbar-thumb:horizontal {
    width: 5px;
    background-color: rgb(169, 169, 169);
    -webkit-border-radius: 2px
  }

}

.cad-shop-list {
  height: 90vh;
  overflow-y: auto;
  padding-right: 10px;
}

.cad-shop-box {
  .cad-shop-box-row {
    height: 123px;

    .cad-shop-box-col {
      height: 100%;
      position: relative;
    }
  }

  .cad-shop-box-checkbox {
    position: relative;
    line-height: 100px;
    padding-left: 1px;
  }

  .cad-shop-img-box {
    height: 110px;
    width: 110px;
    padding: 10px;
    border: 1px solid #ababab;
    position: relative;
    text-align: center;
    border-radius: 4px;
    margin: auto;

    .cad-shop-img {
      height: 100%;
      width: 100%;
      border-radius: 4px;
    }

    .cad-shop-noImg {
      height: 100%;
      background: rgba(191, 191, 191, 0.3);
      border-radius: 4px;
      line-height: 85px;
    }
  }

  .cad-shop-name {
    padding: 6px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    display: -webkit-box;
    height: 44px;
    font-weight: bold;
  }

  .cad-shop-num {
    line-height: 45px;
    width: 85px;
    margin-left: 6px;
    position: absolute;
    bottom: 0;

    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }

    input[type="number"] {
      -moz-appearance: textfield;
    }

    .cad-shop-num-btn {
      cursor: pointer;
    }
  }

  .cad-shop-delete {
    font-size: 16px;
    cursor: pointer;
    height: 18px;
    width: 18px;
    margin: auto;
    position: absolute;
    //top: 0;
    bottom: 10px;
    right: 20px;
    //left: 0;
  }

}

.cad-shop-car {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50px;
  line-height: 50px;

  .cad-shop-car-checkbox {
    float: left;
    width: 70px;
    position: relative;
    top: -3px;
    padding-left: 1px;
  }

  .cad-shop-car-parts {
    float: left;
    margin-left: 20px;
  }

  .cad-shop-car-btn {
    float: right;
    margin-right: 20px;
  }
}
